package com.sc.web;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class Filter2 implements Filter {

	@Override
	public void destroy() {
		System.out.println(getClass().getName()+" destroyed");
	}

	@Override
	public void doFilter(ServletRequest req, ServletResponse res,
			FilterChain fc) throws IOException, ServletException {
		System.out.println("Session Validating.......Filter2");
		PrintWriter out=res.getWriter();
		fc.doFilter(req, res);
		out.println("filter2 closed");

	}

	@Override
	public void init(FilterConfig arg0) throws ServletException {
		System.out.println(getClass().getName()+" initialized");

	}

}
